<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
| 管理后台的路由  先去掉 , 'admin.auth'
*/

// 登录登出接口
Route::group(['prefix' => 'v1/admins','middleware' => ['web', 'cross']],function() {
    // 登录
    Route::post('/login','API\AdminController@login');
    Route::post('/logout','API\AdminController@logout');
});

Route::group(['prefix' => 'v1/meeting-overview', 'middleware' => ['web', 'cross', 'admin.auth']],function() {
    //查询代金券
    Route::post('/store','API\MeetingOverviewAPIController@store');
    Route::get('/lists','API\MeetingOverviewAPIController@search');
    Route::get('/query/{id}','API\MeetingOverviewAPIController@show')->where('id', '[0-9]+');
    // 修改信息
    Route::post('/{id}','API\MeetingOverviewAPIController@update')->where('id', '[0-9]+');
    Route::post('/delete/{id}','API\MeetingOverviewAPIController@destroy')->where('id', '[0-9]+');
    Route::post('/batch/delete','API\MeetingOverviewAPIController@batchDestroy');
});

Route::group(['prefix' => 'v1/meeting', 'middleware' => ['web', 'cross', 'admin.auth']],function() {
    //查询代金券
    Route::post('/store','API\MeetingAPIController@store');
    Route::get('/lists','API\MeetingAPIController@search');
    //Route::get('/query/{id}','API\MeetingAPIController@show')->where('id', '[0-9]+');
    // 修改信息
    Route::post('/{id}','API\MeetingAPIController@update')->where('id', '[0-9]+');
    // 修改回顾
    Route::post('/{id}/overviews','API\MeetingOverviewAPIController@batchUpdate')->where('id', '[0-9]+')->where('oid', '[0-9]+');
    Route::post('/delete/{id}','API\MeetingAPIController@destroy')->where('id', '[0-9]+');
    Route::post('/batch/delete','API\MeetingAPIController@batchDestroy');
});

Route::get('v1/meeting/query/{id}', 'API\MeetingAPIController@show')->where('id', '[0-9]+');

Route::group(['prefix' => 'v1/user-meeting', 'middleware' => ['web', 'cross', 'admin.auth']],function() {
    //查询代金券
    Route::get('/lists','API\UserMeetingAPIController@search');
    Route::get('/export','API\UserMeetingAPIController@export');
    Route::post('/{id}/apply', 'API\UserMeetingAPIController@applyTicket')->where('id', '[0-9]+');
});

Route::group(['prefix' => 'v1/user/ticket', 'middleware' => ['web', 'cross','admin.auth']],function() {
    //查询代金券
    Route::get('/lists','API\UserTicketController@backstageSearch');
    Route::get('/export','API\UserTicketController@export');
});

Route::group(['prefix' => 'v1/meeting-guest', 'middleware' => ['web', 'cross', 'admin.auth']],function() {
    //查询代金券
    Route::post('/store','API\MeetingGuestAPIController@store');
    Route::get('/lists','API\MeetingGuestAPIController@search');
    Route::get('/query/{id}','API\MeetingGuestAPIController@show')->where('id', '[0-9]+');
    // 修改信息
    Route::post('/{id}','API\MeetingGuestAPIController@update')->where('id', '[0-9]+');
    Route::post('/delete/{id}','API\MeetingGuestAPIController@destroy')->where('id', '[0-9]+');
    Route::post('/batch/delete','API\MeetingGuestAPIController@batchDestroy');
});

Route::group(['prefix' => 'v1/comment', 'middleware' => ['web', 'cross', 'admin.auth']],function() {
    //查询代金券
    Route::get('/lists','API\UserCommentAPIController@search');
    Route::get('/query/{id}','API\UserCommentAPIController@show')->where('id', '[0-9]+');
    // 修改信息
    Route::post('/batch/delete','API\UserCommentAPIController@batchDestroy');
    Route::post('/batch/set_hot','API\UserCommentAPIController@batchSet');
});

Route::group(['prefix' => 'v1/common','middleware' => ['web', 'cross']],function() {
    // 登录
    Route::get('/city/list','API\Admin\V1Controller@getCityList');
});
